extends "../tansuozhe-1/tansuozhe-1.gd"
func _extInit():
	._extInit()
	chaName = "「塞壬」探索者I型"
	lv = 2             #等级的设置
	addSkill("每{cd}秒对随机敌方单位进行灼烧，每秒损失最大生命值5%，装甲降低50%，持续10秒", "幽火", "tansuozhe1", 8)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "tansuozhe1":
		tansuozhe1()

func tansuozhe1():
	var enemy = getAllChas(1)
	enemy.shuffle()
	for i in enemy:
		if i.hasBuff("b_youHuo") != null:continue
		castBuff(i, b_youHuo.new(10))
		break

class b_youHuo:
	extends "../../../../azurlane_ctrl/AzurBuff.gd"
	var cha
	func _init(lv = 1):
		attInit()
		id = "b_youHuo"	
		isNegetive = true
		att.defL = -0.5    
		life = lv 
		buffName = "幽火"
	var index = 1
	func _upS():
		casCha.holyDmg(masCha, masCha.att.maxHp * 0.05, "幽火")
	func _del():
		._del()
		if casCha.lv > 2:
			var enemy = masCha.getAllChas(2)
			enemy.sort_custom(masCha, "sortByDistance")
			for i in enemy:
				if i.hasBuff("b_youHuo") != null:continue
				casCha.castBuff(i, b_youHuo.new(10))
				break
